<?php

       $m 	= new Mongo();
       $db 	= $m->gshow;
       $filename = $_GET['filename'];

       // GridFS
       $gridFS = $db->getGridFS();     
       $image = $gridFS->findOne(array('filename'=>$filename));

       //设定文档类型，显示图片
       header('Content-type: image/jpeg');
       echo $image->getBytes();

